package com.useeinfo.oa.common.utils.exception.view;

import com.useeinfo.oa.common.exception.dto.ExceptionDto;
import com.useeinfo.oa.common.utils.exception.JudgmentView;
import org.springframework.http.HttpStatus;
import org.springframework.security.access.AccessDeniedException;


/**
 * @author geniusj
 * @email 975473185@qq.com
 * @date 2018/8/20  下午3:12
 */
public class AccessDeniedJudgmentView implements JudgmentView{

    static final String ACCESS_DENIED_VIEW = "/error/403";

    private AccessDeniedException exception;

    public AccessDeniedJudgmentView(AccessDeniedException exception) {
        this.exception = exception;
    }

    @Override
    public ExceptionDto getViewDetail() {
        return new ExceptionDto(exception,"无访问权限", HttpStatus.FORBIDDEN,ACCESS_DENIED_VIEW);
    }
}
